<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Kostka do gry zrobiona przez  Danonka</title>
	<script>
		var losuj=function(){
			var a=document.getElementById("x");
			
			window.setTimeout(function(){
				a.innerHTML="3";
			}, 1000);
			
			window.setTimeout(function(){
				a.innerHTML="2";
			}, 2000);
			
			window.setTimeout(function(){
				a.innerHTML="1";
			}, 3000);
			
			window.setTimeout(function(){
				a.innerHTML="<img src='kostka" + (parseInt(Math.random()*100)%6+1)  +".png' />";
			}, 4000);
		};
	</script>
	</head>
	<body>
		<button onclick="losuj()">Rzuć Kostką</button>
		<div id="x"></div>
	</body>
</html>